{% extends "fronted/base.html" %}

{% block main %}
    <div class="box box-primary" style="width: 70%; float: left;">
        <div class="box-header with-border"><h3 class="box-title">{{ private.discuss.title }}</h3></div>
        <div class="box-body table-responsive">{{ private.discuss.content|safe }}</div>
    </div>
    <div class="box box-primary" style="width: 29%; float: right;">
        <div class="box-header with-border"><h3 class="box-title">信息</h3></div>
        <div class="box-body table-responsive">
            <table class="table table-hover">
                <tbody>
                    <tr>
                        <td>发布者</td>
                        <td>{{ private.discuss.user }}</td>
                    </tr>
                    <tr>
                        <td>发布时间</td>
                        <td>{{ private.discuss.time }}</td>
                    </tr>
                    <tr>
                        <td>板块</td>
                        <td><a href="{{ url_for("fronted.discuss_board", board_name = private.discuss.board, page = 1) }}">{{ private.discuss.board }}</a></td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div class="box box-primary" style="width: 100%; float: left;">
        <div class="box-header with-border"><h3 class="box-title">发表评论</h3></div>
        <div class="box-body table-responsive">
            {% if message %}
                <div class="callout callout-danger">
                    <p>{{ message }}</p>
                </div>
            {% endif %}
            <form action="" method="post">
                <div class="form-group">
                    <label>评论内容</label>
                    <textarea class="form-control" rows="5" name="comment_content" placeholder="评论内容"></textarea>
                </div>
                <div class="row">
                    <div class="col-xs-4" style="float: left;">
                        <button type="submit" class="btn btn-primary btn-block btn-flat">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="box box-primary" style="width: 100%; float: left;">
        <div class="box-header with-border"><h3 class="box-title">评论</h3></div>
        <div class="box-body table-responsive">
            <iframe src="{{ url_for("fronted.comment_list", discuss_id = private.discuss.id, page = 1) }}" frameborder="0" style="width: 100%; height: 500px;"></iframe>
        </div>
    </div>
{% endblock %}